package com.example.demo.domain;

import com.example.demo.service.CategoryOperation;

import java.util.Date;
import java.util.List;

/**
 * 类目DO类
 */
public class CategoryDO {
    /**
     * 类目id
     */
    private Long id;
    /**
     * 类目编号
     */
    private Integer itemCode;
    /**
     * 类目描述
     */
    private String itemComment;
    /**
     * 父类目id
     */
    private Integer parentId;
    /**
     * 创建时间
     */
    private Date gmtCreate;
    /**
     * 更新时间
     */
    private Date gmtModified;
    /**
     * 子类目
     */
    private List<CategoryDO> children;

    public void execute(CategoryOperation operation){
        operation.doExecute(this);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getItemCode() {
        return itemCode;
    }

    public void setItemCode(Integer itemCode) {
        this.itemCode = itemCode;
    }

    public String getItemComment() {
        return itemComment;
    }

    public void setItemComment(String itemComment) {
        this.itemComment = itemComment;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Date getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(Date gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public Date getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Date gmtModified) {
        this.gmtModified = gmtModified;
    }

    public List<CategoryDO> getChildren() {
        return children;
    }

    public void setChildren(List<CategoryDO> children) {
        this.children = children;
    }
}
